package com.algorithm.middleware.LRU;

/**
 * @author liyanhao
 * @Date 2023-02-12 20:54
 */
public class Node {
    private int key;
    private int value;
    private Node pre,next;

    public Node(int key, int value) {
        this.key = key;
        this.value = value;
    }

    public int getValue(int key) {
        return value;
    }

    //上一个元素
    public Node getPre() {
        return pre;
    }

    //下一个元素
    public void setPre(Node pre) {
        this.pre = pre;
    }

    public Node getNext() {
        return next;
    }

    public void setNext(Node next) {
        this.next = next;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public Integer getKey() {
        return key;
    }
}
